<template>
	<view style="position: relative;">
	
		<view class="pageContent">
			<view class="listContent">
				
					<view v-for="(data,index) in listData" @click="onSpace(data)" :key='data.spaceId' class="listCell flexBetweenCenter" :class="{activeList:flag==data.id}">
						<span>{{data.projectName}}</span>
						<span style='margin-right: 15px;' v-if='flag==data.spaceId'>
							<image src="../../static/success.png" mode=""></image>
						</span>
					</view>

				<!-- </view> -->
			</view>



		</view>
		<view class="listBottom flexCenterCenter">
			<!-- <view class="flexCenterCenter"> -->
			<van-button type="info" @click='onConfim(flag)' style='width: 100%;'>确认</van-button>
			<!-- </view> -->

		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				listData: [],
				flag: 0
			}
		},
		methods: {
			onBack() {
				uni.redirectTo({
					url: '../home/home'
				});
			},
			//点击确认
			onConfim(data) {
				// console.log(data);
				uni.redirectTo({
					url: `../home/home`
				});
			},
			onSpace(data){
				this.flag=data.spaceId
				
				uni.setStorageSync('spaceData', data)
			}
		},
		onShow() {
		
			this.listData=uni.getStorageSync('appSpaceVOList')
		}
	}
</script>

<style scoped>
	.topTitleActive {
		position: fixed;
		width: 100%;
		top: 0;
		z-index: 99;

		background: #fff;

	}

	.listCell {
		border-bottom: 1px solid #f0f0f0;
		/* margin-bottom: 10px; */
		margin:0 15px;
		padding: 14px 0;
		/* padding-left: 15px; */
	}

	.listCell ::v-deep image {
		width: 16px;
		height: 16px;
	}

	.listContent :last-child {
		border: none;
	}

	.activeList {
		color: #1890ff;
	}

	/* .listCell:hover{
		border: 1px solid #1890ff;
	} */
	.pageContent {
		/* padding: 20px;
		padding-bottom: 40px; */
		/* padding-top: 10px; */
		color: #333;
	}

	.listTitle {
		background: #F7F8FA;
		color: #999;
		padding: 18px 0 8px;
		font-size: 14px;
		padding-left: 10px;
	}

	.listBottom {
		position: fixed;
		bottom: 30px;
		padding: 0 20px;
		width: 100%;
	}

	.listBottom ::v-deep .van-button--info {
		font-size: 15px;
		color: #fff;
		background-color: #007AFF;
		border: none;
		/* margin: 0 20px; */
		/* width: 100px; */
		width: calc(100% - 40px);

	}
</style>
